import axiosIns from '../../utils/request'

export default {
  getAllRoles () {
    return axiosIns.get('/roles')
  },

  updataRoleById (roleId, rightId) {
    return axiosIns.delete(`roles/${roleId}/rights/${rightId}`)
  },

  getAllRolesByTree () {
    return axiosIns.get('rights/tree')
  },

  setUserRoleById (roleId, rids) {
    return axiosIns.post(`roles/${roleId}/rights`, { rids: rids })
  }
}
